﻿using UnityEngine;

public class UnityViewService : IViewService
{
    public void CreatePlayerView(GameEntity e)
    {
        GameObject bellePrefab = Resources.Load<GameObject>("Belle/Prefabs/belle");
        GameObject belle = GameObject.Instantiate(bellePrefab);
        belle.name = "belle";
        var playerUnityObject = belle.AddComponent<PlayerUnityObject>();
        playerUnityObject.Link(e);
        e.AddView(playerUnityObject);
    }

    public void CreateWallView(GameEntity e)
    {
        GameObject wall = new GameObject("wall");
        var wallUnityObject = wall.AddComponent<WallUnityObject>();
        wallUnityObject.Link(e);
        e.AddView(wallUnityObject);
    }

    public void CreateGraphView(GameEntity e)
    {
        GameObject graph = new GameObject("graph");
        var graphUnityObject = graph.AddComponent<GraphUnityObject>();
        graphUnityObject.Link(e);
        e.AddView(graphUnityObject);
    }

    public void CreateCellSpaceView(GameEntity e)
    {
        GameObject cellSpace = new GameObject("cellSpace");
        var cellSpaceUnityObject = cellSpace.AddComponent<CellSpaceUnityObject>();
        cellSpaceUnityObject.Link(e);
        e.AddView(cellSpaceUnityObject);
    }

    public void CreateTurrentView(GameEntity e)
    {
        GameObject cellSpace = new GameObject("turrent");
        var turrentUnityObject = cellSpace.AddComponent<TurrentUnityObject>();
        turrentUnityObject.Link(e);
        e.AddView(turrentUnityObject);
    }

    public void CreateThroneView(GameEntity e)
    {
        GameObject throne = new GameObject("throne");
        var throneUnityObject = throne.AddComponent<ThroneUnityObject>();
        throneUnityObject.Link(e);
        e.AddView(throneUnityObject);
    }

    public void CreateSpawnView(GameEntity e)
    {
        GameObject spawn = new GameObject("spawn");
        var spawnUnityObject = spawn.AddComponent<SpawnUnityObject>();
        spawnUnityObject.Link(e);
        e.AddView(spawnUnityObject);
    }
}